let $axios = require('axios')
$axios.defaults.baseURL = 'http://localhost:8090/api'

/**
 * 模糊查询接口
 * @param params
 * @returns {Promise<unknown>}
 */
export function queryInventory(params){
  return new Promise((resolve, reject) => {
    $axios.get(`/inventory/goods/find?info=${params}`).then(resp=>{
      if(resp&&resp.status==200){
        resolve(resp);
      }
      reject(resp);
    })
  })
}
/**
 * 加载库存商品接口
 * @param params
 * @returns {Promise<unknown>}
 */
export function loadInventory(params){
  return new Promise((resolve, reject) => {
    $axios.post(`/inventory/kind`,params).then(resp=>{
      if(resp&&resp.status==200){
        resolve(resp);
      }
      reject(resp);
    })
  })
}


